package cn.rengy.web.framework.sys.rolemenu.web;

import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresRoles;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.rengy.lang.ResultEntity;
import cn.rengy.web.framework.sys.rolemenu.service.RoleMenuService;


/**
 * 负责打开登录页面(GET请求)和登录出错页面(POST请求)，
 * 
 * 
 */
@Controller
@RequestMapping(value = "/authenticated/rolemenu")
public class RoleMenuController {
	private static Logger logger = LoggerFactory.getLogger(RoleMenuController.class);
	@Autowired
	private RoleMenuService roleMenuService;
	
	/**
	 * 角色菜单权限设置
	 * @param paramMap
	 * @return
	 */
	@RequestMapping(method = RequestMethod.POST)
	@ResponseBody
	@RequiresRoles(value={"developer"})
	public ResultEntity<?> update (@RequestBody Map<String,Object> paramMap){
		roleMenuService.update(paramMap);
		return ResultEntity.ok();
	}
	
	
}
